package com.campus.commons.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;

import com.campus.app.mapper.Insert;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * <p>
 * 学社审核
 * </p>
 *
 * @author Rin
 * @since 2021-01-26
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SocietyFor对象", description="学社审核")

public class SocietyFor implements Serializable {
    public SocietyFor(Integer id) {
        this.id = id;
    }

    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "请求状态：0 刚刚提交，2.代表老师通过，3考试通过，4部门老师通过，5校长通过")
    @TableField("applyState")
    @Null(groups = Insert.class)
    private Integer applystate;

    @ApiModelProperty(value = "申请的学生Id")
    @TableField("studentId")
    @NotNull(groups = Insert.class)
    private Integer studentid;
    @TableField(exist = false)
    private Integer userId;
    @TableField(exist = false)
    private String studentName;
    @TableField("applyDate")
    private Date applydate;
    @ApiModelProperty(value = "通知状态")
    @TableField("sendSate")
    private int sendsate;
    @TableField(exist = false)
    private Class aClass;
    @ApiModelProperty(value = "部门Id")
    @TableField("deId")
    private Integer deid;
    @TableField(exist = false)
    private Departments departments;
    @ApiModelProperty(value = "受理中")
    private Integer handle;

    @ApiModelProperty(value = "处理时间；")
    @TableField("updateTime")
    private Date updatetime;

    @ApiModelProperty(value = "申请说明")
    private String mess;

    @ApiModelProperty(value = "对学社的看法")
    @TableField("userSuggest")
    private String usersuggest;

    @ApiModelProperty(value = "自我评价")
    private String evaluation;

    @ApiModelProperty(value = "加入初衷")
    private String initial;

    @ApiModelProperty(value = "班主任Id")
    @TableField("lifeTchId")
    @NotNull(groups = Insert.class)
    private Integer lifetchid;
    @TableField(exist = false)
    private String lifeTchName;

    @ApiModelProperty(value = "教员Id")
    @TableField("tchId")
    @NotNull(groups = Insert.class)
    private Integer tchid;
    @TableField(exist = false)
    private String tchName;

    @ApiModelProperty(value = "班主任评语")
    @TableField("lifeTchOpinion")
    @Null(groups = Insert.class)
    private String lifetchopinion;

    @ApiModelProperty(value = "教员评语")
    @TableField("tchOpinion")
    @Null(groups = Insert.class)
    private String tchopinion;

    @ApiModelProperty(value = "笔试分数")
    @TableField("penExam")
    @Null(groups = Insert.class)
    private Integer penexam;

    @ApiModelProperty(value = "机试分数")
    @TableField("computerExam")
    @Null(groups = Insert.class)
    private Integer computerexam;

    @ApiModelProperty(value = "面试分数")
    @TableField("interView")
    @Null(groups = Insert.class)
    private Integer interview;
    @TableField(exist = false)
    private Class grade;
    @ApiModelProperty(value = "部门老师评语")
    @TableField("deTchOpinion")
    @Null(groups = Insert.class)
    private String detchopinion;

    @ApiModelProperty(value = "校长评语")
    @TableField("rectorOpinion")
    @Null(groups = Insert.class)
    private String rectorOpinion;
    public void setStudentid(Integer studentid) {
        Student student = Student.students.get(studentid);
        this.studentid = studentid;
        this.studentName = student.getStuname();
        this.userId=student.getUserid();
        this.grade = Class.classes.get(student.getClassid());
    }

    public void setDeid(Integer deid) {
        this.deid = deid;
        this.departments = Departments.departmentsMap.get(deid);
    }

    public void setLifetchid(Integer lifetchid) {
        this.lifetchid = lifetchid;
        this.lifeTchName = Teacher.teachers.get(lifetchid).getTeachername();
    }

    public void setTchid(Integer tchid) {
        this.tchid = tchid;
        this.tchName = Teacher.teachers.get(tchid).getTeachername();
    }

}
